package com.lk.ii.service.impl;

import java.util.List;
import com.lk.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lk.ii.mapper.IiCaseMapper;
import com.lk.ii.domain.IiCase;
import com.lk.ii.service.IIiCaseService;
import com.lk.common.core.text.Convert;

/**
 * 案例Service业务层处理
 * 
 * @author lk
 * @date 2021-02-22
 */
@Service
public class IiCaseServiceImpl implements IIiCaseService 
{
    @Autowired
    private IiCaseMapper iiCaseMapper;

    @Override
    public List<IiCase> getCasePageList(Long pageSize, Long offset)
    {
        return iiCaseMapper.getCasePageList(pageSize, offset);
    }

    /**
     * 查询案例
     * 
     * @param id 案例ID
     * @return 案例
     */
    @Override
    public IiCase selectIiCaseById(Long id)
    {
        return iiCaseMapper.selectIiCaseById(id);
    }

    /**
     * 查询案例列表
     * 
     * @param iiCase 案例
     * @return 案例
     */
    @Override
    public List<IiCase> selectIiCaseList(IiCase iiCase)
    {
        return iiCaseMapper.selectIiCaseList(iiCase);
    }

    /**
     * 新增案例
     * 
     * @param iiCase 案例
     * @return 结果
     */
    @Override
    public int insertIiCase(IiCase iiCase)
    {
        iiCase.setCreateTime(DateUtils.getNowDate());
        return iiCaseMapper.insertIiCase(iiCase);
    }

    /**
     * 修改案例
     * 
     * @param iiCase 案例
     * @return 结果
     */
    @Override
    public int updateIiCase(IiCase iiCase)
    {
        iiCase.setUpdateTime(DateUtils.getNowDate());
        return iiCaseMapper.updateIiCase(iiCase);
    }

    /**
     * 删除案例对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteIiCaseByIds(String ids)
    {
        return iiCaseMapper.deleteIiCaseByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除案例信息
     * 
     * @param id 案例ID
     * @return 结果
     */
    @Override
    public int deleteIiCaseById(Long id)
    {
        return iiCaseMapper.deleteIiCaseById(id);
    }
}
